package yxk.service.configm;

import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.sdk.wtc.wtes.business.tie.init.configmix.TieConfigMixInitPlugin;
import kd.sdk.wtc.wtes.business.tie.init.configmix.TieConfigMixQueryEvent;

import java.util.Arrays;

/**
 * 配置组合
 */
public class TieConfigMixInitPluginImp implements TieConfigMixInitPlugin {
    @Override
    public void onQuery(TieConfigMixQueryEvent event) {
        QFilter qFilters = new QFilter("number", QCP.equals,"asimco");
       /* qFilters[0] = new QFilter("status", QCP.equals, "C");
        qFilters[1] = new QFilter("iscurrentversion", QCP.equals, Boolean.TRUE);
        qFilters[2] = new QFilter("enable", QCP.equals, "1");
        qFilters[3]=*/
        DynamicObject[] dynamicObjects = BusinessDataServiceHelper.load("wtbd_confcombin", "countryid.number,attitemmap.id,attstsmap.id,tbpcrelcnf.id,entryentity.biztype,entryentity.exattr,entryentity.attendattr,entryentity.datasource", qFilters.toArray());

        // 设置查询的组合配置
        event.addConfigMixResult(Arrays.asList(dynamicObjects));
    }
}
